package tech.ezrealc.fall2023.controller.personnel;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.ezrealc.fall2023.model.common.ResponseModel;
import tech.ezrealc.fall2023.model.personnel.student.mapper.StudentMapper;
import tech.ezrealc.fall2023.service.personnel.StudentService;

@RestController
@RequestMapping("/api/personnel/student")
@CrossOrigin
public class StudentController {

    @Resource
    private StudentService studentService;

    @Resource
    private StudentMapper studentMapper;

    @GetMapping
    public ResponseModel query() {
        return ResponseModel.success(studentMapper.toVOList(studentService.queryAll()));
    }

}
